package com.gzedu.module.controller.curd;

import java.io.UnsupportedEncodingException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.gzedu.common.sys.controller.BaseController;

/**
 * 弹出层controller
 * @author pc1234
 *
 */
@Controller
@RequestMapping("/curdPop")
public class CurdPopController extends BaseController{
	
	@RequestMapping("/toPop")
	public String toPop(HttpServletRequest request, HttpServletResponse response,Model model,String val){
		try {
			if(!"".equals(val) && val != null){
				String[] valStr = val.split(",");
				model.addAttribute("btnNo", valStr[0].trim());
				
				model.addAttribute("btnName",new String(valStr[1].trim().getBytes("ISO-8859-1"),"UTF-8"));
				
				model.addAttribute("btnClick",valStr[2].trim());
			}
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "/views/iframePop/btnPop";
	}
	
	@RequestMapping("/toSearchPop")
	public String toSearchPop(HttpServletRequest request, HttpServletResponse response,Model model,String val){
		return "/views/iframePop/searchPop";
	}
	
	@RequestMapping("/toJsPop")
	public String toJsPop(HttpServletRequest request, HttpServletResponse response,Model model){
		return "/views/iframePop/jsPop";
	}
}
